package com.yourname.xhs.service;

import com.yourname.xhs.bean.Announce;
import com.yourname.xhs.dao.AnnounceDaoImpl;
import com.yourname.xhs.entity.User;

import java.sql.SQLException;
import java.util.List;

public class AnnounceServiceImpl implements AnnounceService{
    AnnounceDaoImpl adi=new AnnounceDaoImpl();
    //创建通告
    public boolean createAnnounce(String content) throws SQLException {
        Announce announce=new Announce();
        announce.setContent(content);
        if(adi.createAnnounce(announce)) {
            return true;
        }
        else {
            return false;
        }
    }


    //查看通告
    public List<Announce> selectAnnounce() throws Exception {
        return adi.selectAnnounce();
    }


    //删除通告
    public int deleteAnnounceById(Long id){
       return adi.deleteAnnounce(id);
    }
}
